package com.example.mapper;

import com.example.entity.Pet;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface PetMapper {

    int insert(Pet pet);

    void updateById(Pet pet);

    void deleteById(Integer id);

    Pet selectById(Integer id);

    List<Pet> selectAll(Pet pet);
    @Update("UPDATE pet SET read_count = read_count + 1 WHERE id = #{id}")
    void readPet(Integer id);

    /**
     * @description: 根据read数量和收藏数量进行排序
     * @param: []
     * @return: java.util.List<com.example.entity.Pet>
     * @process: 添加流程描述
     **/
    List<Pet> rank();

    List<Pet> rankType(Integer typeId);
}
